package cn.juochiu.spring.project;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;

@SpringBootApplication
public class RabbitMqApplication {

    private static Logger log = LoggerFactory.getLogger(RabbitMqApplication.class);

    @Autowired
    private Environment env;

    public static void main(String[] args) {
        log.info("--springboot--rabbitmq--project--start---启动");
        ApplicationContext ctx = SpringApplication.run(RabbitMqApplication.class, args);

        String[] activeProfiles = ctx.getEnvironment().getActiveProfiles();
        for (String profile : activeProfiles) {
            log.warn("-------Spring Boot 【rabbitmq】  使用profile为:{}", profile);

        }
    }
}
